<template>
  <div>
    <div
      class="list_li padding-20 border-bottom"
      v-for="(item,index) in list"
      :key="index"
      @click="to(item.user_id)"
    >
      <div class="flex align-center margin-b20">
        <img
          class="list_li_img radius-50p margin-r24"
          :src="item.head_img?item.head_img:$nologin"
          alt
        />
        <div class="rem-30px flex-grow text-cut-two line-40">{{item.article_title}}</div>
      </div>
      <div class="flex padding-lr15 line-60 justify-between rem-26px">
        <div>
          <span class="inline-block margin-r10">{{item.user_phone}}</span>
        </div>
        <span class="c-99">{{item.created_at}}</span>
      </div>
    </div>

    <load @loadData="getData" :list="list" :total="total" :nodata="list.length<10?true:false"></load>
  </div>
</template>


<script>
import load from "../components/load";
export default {
  components: {
    load
  },
  data() {
    return {
      list: [],
      total: 0,
      page: 1
    };
  },
  mounted() {
    document.querySelector("html").style.backgroundColor = "#ffffff";
    this.getData(1);
  },
  methods: {
    getData(page) {
      this.$axios
        .post("/home/record/articleBrowsing", {
          token: window.localStorage.getItem("qx_token"),
          page: page,
          limit: 10
        })
        .then(res => {
          if (page == 1) {
            this.list = [];
            this.topList = [];
          }
          if (res.data.data.data.length == 0) {
            this.total++;
            return false;
          }
          for (let i in res.data.data.data) {
            this.list.push(res.data.data.data[i]);
          }
        });
    },
    to(id) {
      this.$router.push({
        path: "/recruit/card/",
        query: {
          id: id
        }
      });
    }
  }
};
</script>

<style scoped>
.list_li_img {
  width: 0.98rem;
  height: 0.98rem;
  display: block;
}
.border-bottom {
  border: none;
}
</style>